---
title: Spinner | gluestack-ui | Installation, Usage, and API

description: Spinners are designed to give visual cues to users that an action is being processed or that a change or result is expected. They are useful for improving the user experience by reducing frustration and uncertainty.

pageTitle: Spinner

pageDescription: Spinners are designed to give visual cues to users that an action is being processed or that a change or result is expected. They are useful for improving the user experience by reducing frustration and uncertainty.

showHeader: true
---

import { Meta } from '@storybook/addon-docs';

<Meta title="ui/Components/Feedback/Spinner" />

import { Spinner, HStack, VStack, Text } from './Spinner';
import { transformedCode } from '../../../utils';
import { AppProvider, CodePreview } from '@gluestack/design-system';

import Wrapper from '../../Wrapper';

This is an illustration of a **Themed Spinner** component with default configuration.

<AppProvider>
  <CodePreview
    showComponentRenderer={true}
    showArgsController={true}
    metaData={{
      code: `
          <Spinner {...props}/>
      `,
      transformCode: (code) => {
        return transformedCode(code);
      },
      scope: { Wrapper, Spinner },
      argsType: {
        size: {
          control: 'select',
          options: ['small', 'large'],
          default: 'small',
        },
      },
    }}
  />
</AppProvider>

<br />

## API Reference

### Import

To use this component in your project, include the following import statement in your file.

```jsx
import { Spinner } from '@gluestack-ui/themed';
```

### Anatomy

The structure provided below can help you identify and understand a Spinner component's various parts.

```jsx
export default () => <Spinner />;
```

### Component Props

This section provides a comprehensive reference list for the component props, detailing descriptions, properties, types, and default behavior for easy project integration.

#### Spinner

Contains all Spinner related layout style props and actions.
It inherits all the properties of React Native's [ActivityIndicator](https://reactnative.dev/docs/activityindicator) component.

### Accessibility

We have outlined the various features that ensure the Fab component is accessible to all users, including those with disabilities. These features help ensure that your application is inclusive and meets accessibility standards.

#### Keyboard

- Tab: Moves focus to the next focusable element.

#### Screen Reader

- VoiceOver: When the Spinner is focused, the screen reader will announce the loading indicator.

### Examples

The Examples section provides visual representations of the different variants of the component, allowing you to quickly and easily determine which one best fits your needs. Simply copy the code and integrate it into your project.

#### Spinner with Label

A Spinner component with a label provides informative text or a label alongside the spinner, offering descriptive context and improving user understanding and interaction with the spinner element within a user interface.

<AppProvider>
  <CodePreview
    showComponentRenderer={true}
    showArgsController={false}
    metaData={{
      code: `
        <HStack space="sm" >
          <Spinner/>
          <Text size="md">Please Wait</Text>
        </HStack>
      `,
      transformCode: (code) => {
        return transformedCode(code);
      },
      scope: {
        Wrapper,
        Spinner,
        HStack,
        Text,
      },
      argsType: {},
    }}
  />
</AppProvider>

#### Color Scheme

A Spinner component with a color scheme enhances visual appeal by incorporating distinct colors, adding a touch of customization and style to the spinner element within a user interface.

<AppProvider>
  <CodePreview
    showComponentRenderer={true}
    showArgsController={false}
    metaData={{
      code: `
      <VStack space="md" >
        <Spinner color="$indigo600" />
        <Spinner color="$emerald600" />
        <Spinner color="$amber600" />
        <Spinner color="$fuchsia600" />
      </VStack>
    `,
      transformCode: (code) => {
        return transformedCode(code);
      },
      scope: {
        Wrapper,
        Spinner,
        VStack,
      },
      argsType: {},
    }}
  />
</AppProvider>

## Unstyled

All the components in `gluestack-ui` are unstyled by default. To customize your UI using the extendedTheme, please refer to this [link](https://gluestack.io/ui/docs/theme-configuration/customizing-theme/eject-library). The import names of components serve as keys to customize each component.

<!--

### Advanced

We provide in-depth information on how to customize and extend the component's functionality to meet your needs. Below, we describe how to modify the component to suit your requirements.

### Customizing the Spinner

We have a function called `createSpinner` which can be used to create a custom `Spinner` component. This function takes in a configuration object which contains the styled components that you want to use for the spinner. You can refer [gluestack.io/style](/style/docs/getting-started/styled) on how to use styled components.

#### Usage

Default styling of all these components can be found in the `components/core/spinner` file. For reference, you can view the [source code](https://github.com/gluestack/gluestack-ui/blob/main/packages/themed/src/components/Spinner) of the styled `Spinner` components.

```jsx
// import the styles
import { Root } from '../components/core/spinner/styled-components';

// import the createSpinner function
import { createSpinner } from '@gluestack-ui/spinner';

// Understanding the API
const Spinner = createSpinner({
  Root,
});

// Using the spinner component
export default () => <Spinner />;
```
-->

## Spec Doc

Explore the comprehensive details of the Spinner in this document, including its implementation details, checklist, and potential future additions. Dive into the thought process behind the component and gain insights into its development journey.

<iframe
  style={{
    borderRadius: '8px',
    border: ' 1px solid rgba(0, 0, 0, 0.1)',
    aspectRatio: 736 / 585,
  }}
  src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Fproto%2FNcXOxqKbdnGsLQNex3H76u%2F%25C2%25A0%25F0%259F%2593%259Agluestack-UI-handbook%3Ftype%3Ddesign%26node-id%3D6300-39672%26t%3DS9Au6CP5yb4upkgu-1%26scaling%3Dscale-down%26page-id%3D6300%253A37770%26starting-point-node-id%3D6300%253A39672%26mode%3Ddesign"
  allowFullScreen
/>
